﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteMain.Master" Inherits="System.Web.Mvc.ViewPage<TvGuide.UI.Models.ExternalVideoModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%=ViewData["videoTitle"] %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Head" runat="server">
    <link href="/Content/admin.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="HomeFBOpenGraphTags" ContentPlaceHolderID="FBOpenGraphTagsHolder"
    runat="server">
    <meta property="fb:app_id" content="197849216924945">
    <meta property="og:url" content="<% = ViewData["pageUrl"]%>" />
    <meta property="og:title" content="<%=ViewData["videoTitle"] %>" />
    <meta property="og:description" content="<%=ViewData["desc"] %>" />
    <meta property="og:type" content="video">
    <meta property="og:video" content="<%=ViewData["pageUrl"]%>" />
    <meta property="og:video:type" content="text/html" />
    <meta property="og:video:width" content="396">
    <meta property="og:video:height" content="297">
    <meta property="og:image" content="<%=ViewData["tubImgUrl"]%>" />
    <meta property="og:site_name" content="TVCuyc">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="MainContent" runat="server">
    <div id="fb-root">
    </div>
    <script>        (function (d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=197849216924945";
            fjs.parentNode.insertBefore(js, fjs);
        } (document, 'script', 'facebook-jssdk'));
    </script>
    <h1 id="external-video-title">
        <%=ViewData["videoTitle"] %></h1>
    <div id="external-video-content">
        <iframe id="video-frame" width="640" height="390" src="<%=Model.url%>?version=3&enablejsapi=1&origin=http://www.tvcuyc.am"
            frameborder="0" allowfullscreen enablejsapi="1" origin="http://www.tvcuyc.am"></iframe>
    </div>
    <div id="js-youtube-social-buttons" class="youtube-social-buttons" style="" >
            <div title="Close" id="js-youtube-social-buttons-close" class="d-close" onclick="closeSocialButtons()"></div>
            <div><strong>Շնորհակալություն դիտելու համար!</strong></div>
            <ul class="article-soc-but-icons">
                <li class="youtube-social-fb" style="width: 100%; background-color: #3c5899; height: 45px;">
                    <a href="<%=ViewData["fbShare"] %>" onclick="return popitup('<%=ViewData["fbShare"] %>')"> 
                        <img class="fb_share" border="0" alt="Share on Facebook" src="/Content/imgs/fb-square-icon.png" style="position: relative; top: -5px; left: -10px;">
                        <span style="color: white; position: relative; top: -20px; font-size: 17px; left: -8px;">Կիսվել Ֆեյսբուքում</span>
                    </a>
                </li>
            </ul>
     </div>



    <script>
        var tag = document.createElement('script');
        tag.src = "https://www.youtube.com/iframe_api";
        var firstScriptTag = document.getElementsByTagName('script')[0];
        firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

        var player;
        function onYouTubeIframeAPIReady() {
            player = new YT.Player('video-frame', {
                events: {
                    'onReady': onPlayerReady,
                    'onStateChange': onPlayerStateChange
                }
            });
        }

        function onPlayerReady() {
            //do whatever you want here. Like, player.playVideo();
        }

        function onPlayerStateChange(event) {
            if (event.data === 0) {
                $("#js-youtube-social-buttons").css("display", "block");
            }
        }

        function closeSocialButtons() {
            $("#js-youtube-social-buttons").css("display", "none");
        }
    </script>

    <div id="external-video-comments">
        <div id="fb-like">
            <div class="fb-like" data-send="false" data-width="450" data-show-faces="false">
            </div>
        </div>
        <div id="share-buttons">
            <a href="<%=ViewData["fbShare"] %>" onclick="return popitup('<%=ViewData["fbShare"] %>')">
                <img class='fb_share' src='http://tvcuyc.am/Content/imgs/fb_share.gif' alt='share'
                    border='0' /></a> <a href="<%=ViewData["twitShare"] %>" onclick="return popitup('<%=ViewData["twitShare"] %>')">
                        <img class='tw_share' src='http://tvcuyc.am/Content/imgs/tw_share.gif' alt='share'
                            border='0' /></a>
        </div>
        <div class="fb-comments" data-href="<% = ViewData["pageUrl"]%>" data-num-posts="7"
            data-width="500">
        </div>
    </div>
</asp:Content>
